package com.springcloud.authentication.modules.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.springcloud.authentication.modules.entity.SysPermission;
import com.springcloud.authentication.modules.entity.SysRole;
import com.springcloud.authentication.modules.entity.SysUser;


/**
 * JPQL、HQL、原生sql 都是支持的
 * @author Administrator
 *
 */
public interface PermissionRepository  extends JpaRepository<SysPermission, Integer>{

	@Query(nativeQuery=true,value="select a.id,a.name from sys_permission a,sys_permission_role b where b.sys_permission_id = a.id and b.sys_role_id = ?1")
	List<SysPermission> findRolePermissionList(String roleId);
	

}